#!/bin/sh

## hyphop ##

#= kernel build config

kernel_prepare=kernel_prepare_soft

GCC_PATH=../../gcc-x86_64_aarch64-linux-gnu

[ "$OWN_REPO" ] || \
    OWN_REPO=khadas

[ "$KERNEL_PATH2" ] || \
KERNEL_PATH2=/tmp

TO2=../../

DOWNLOAD_BASE=https://github.com/$OWN_REPO/

[ "$REL" ] || REL=test


[ "$LINUX_VER" ] || LINUX_VER=linux-5.13
[ "$LINUX_VER" ] || LINUX_VER=linux-5.13-rc7
[ "$LINUX_VER" ] || LINUX_VER=linux-5.11.1
[ "$LINUX_VER" ] || LINUX_VER=linux-5.11
[ "$LINUX_VER" ] || LINUX_VER=linux-5.11-rc5
[ "$LINUX_VER" ] || LINUX_VER=linux-5.10.11
[ "$LINUX_VER" ] || LINUX_VER=linux-5.7.7
[ "$LINUX_VER" ] || LINUX_VER=linux-5.7
[ "$LINUX_VER" ] || LINUX_VER=linux-5.4.5
[ "$LINUX_VER" ] || LINUX_VER=linux-5.4-rc5
[ "$LINUX_VER" ] || LINUX_VER=linux-5.3-rc6

[ "$KERNEL_SOURCE_DIR" ] || \
KERNEL_SOURCE_DIR="$KERNEL_PATH2/$LINUX_VER"

[ "$KERNEL_OUTPUT_DIR" ] || \
KERNEL_OUTPUT_DIR="$KERNEL_PATH2/modules"

#LINUX_SRC=pkg/releases/download/aarch64/$LINUX_VER.tar.gz
#LINUX_SRC_SFS=pkg/releases/download/aarch64/$LINUX_VER.squashfs

case $LINUX_VER in
    *rc*)
    LINUX_SRC_=https://git.kernel.org/torvalds/t/linux-${LINUX_VER#*-}.tar.gz
    ;;
    *)
    LINUX_SRC_=https://cdn.kernel.org/pub/linux/kernel/v5.x/$LINUX_VER.tar.xz
    ;;
esac


#LINUX_SRC_SFS_MD5=f10b9d62a892ba6ff6557d230c9e7129

GCC_SRC=pkg/releases/download/aarch64/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz
GCC_SRC_SFS=pkg/releases/download/aarch64/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.squashfs
GCC_SRC_SFS_MD5=cc6bc3721354dfbe7c898b51736ffb35

GCC_SRC=khadas-uboot/releases/download/tc/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz

KERNEL_ADDR=0x01080000
#KERNEL_ADDR=0x0f080000
KERNEL_ADDR=0x0d080000
